/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package healthcare.coursework.model;

import java.io.Serializable;
import java.util.Date;


/**
 *
 * @author Administrator
 */
public class TestSamples implements Serializable {

    private static final long serialVersionUID = 1L;
    protected TestSamplesPK testSamplesPK;
    private String testName;
    private Date trackedDate;
    private RequestStatus requestStatus;
    private String sampleResult;
    private Users user;
    private Patient patient;
    private Facility facility;

    public TestSamples() {
    }

    public TestSamples(TestSamplesPK testSamplesPK) {
        this.testSamplesPK = testSamplesPK;
    }

    public TestSamples(TestSamplesPK testSamplesPK, String testName, RequestStatus requestStatus) {
        this.testSamplesPK = testSamplesPK;
        this.testName = testName;
        this.requestStatus = requestStatus;
    }


    public TestSamples(TestSamplesPK testSamplesPK, Date trackedDate, RequestStatus requestStatus) {
        this.testSamplesPK = testSamplesPK;
        this.trackedDate = trackedDate;
        this.requestStatus = requestStatus;
    }

    public TestSamples(String username, long facilityId, long patientId) {
        this.testSamplesPK = new TestSamplesPK(username, facilityId, patientId);
    }

    public TestSamplesPK getTestSamplesPK() {
        return testSamplesPK;
    }

    public void setTestSamplesPK(TestSamplesPK testSamplesPK) {
        this.testSamplesPK = testSamplesPK;
    }

    public String getTestName() {
        return testName;
    }

    public void setTestName(String testName) {
        this.testName = testName;
    }

    public Date getTrackedDate() {
        return trackedDate;
    }

    public void setTrackedDate(Date trackedDate) {
        this.trackedDate = trackedDate;
    }

    public RequestStatus getRequestStatus() {
        return requestStatus;
    }

    public void setRequestStatus(RequestStatus requestStatus) {
        this.requestStatus = requestStatus;
    }

    public String getSampleResult() {
        return sampleResult;
    }

    public void setSampleResult(String sampleResult) {
        this.sampleResult = sampleResult;
    }

    public Users getUser() {
        return user;
    }

    public void setUser(Users user) {
        this.user = user;
    }

   

    public Patient getPatient() {
        return patient;
    }

    public void setPatient(Patient patient) {
        this.patient = patient;
    }

    public Facility getFacility() {
        return facility;
    }

    public void setFacility(Facility facility) {
        this.facility = facility;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (testSamplesPK != null ? testSamplesPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TestSamples)) {
            return false;
        }
        TestSamples other = (TestSamples) object;
        if ((this.testSamplesPK == null && other.testSamplesPK != null) || (this.testSamplesPK != null && !this.testSamplesPK.equals(other.testSamplesPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "healthcare.coursework.model.TestSamples[testSamplesPK=" + testSamplesPK + "]";
    }

    public String getPatientFullName() {
        return getPatient().getFullName();
    }

//    public String getFacilityName(){
//        return getFacility().getFacilityName();
//    }
}
